import type { RouteRecordRaw } from "vue-router";

export const Routes: Array<RouteRecordRaw> = [
  {
    path: "/search",
    name: "Search",
    component: () => import("../pages/Search/index.vue"),
    meta: {
      isHidden: true
    }
  },
  {
    path: "/searchDetail",
    name: "SearchDetail",
    component: () => import("../pages/Search/SearchDetail/index.vue"),
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("../pages/Home/index.vue"),
    meta: {
      isHidden: false
    }
  },
  {
    name: "Card",
    path: "/Card",
    component: () => import("../pages/Home/card.vue")
  },
  {
    path: "/category",
    name: "Category",
    component: () => import("../pages/Category/index.vue"),
    meta: {
      isHidden: false
    }
  },
  {
    name: "Goods",
    path: "/goods",
    component: () => import("../pages/Category/Goods/index.vue"),
    meta: {
      title: "weini",
    },
  },
  {
     name: "Iphone",
     path: "/iphone",
      component: () => import("../pages/Category/Goods/Iphone/index.vue"),
     meta: {
              title: "shouji",
            }
  },

  {
    path: "/user",
    name: 'User',
    component: () => import("../pages/User/index.vue"),
    meta: {
      isHidden: false
    }
  },
  {
    path: "/cart",
    name: 'Cart',
    component: () => import("../pages/Cart/index.vue"),
    meta: {
      isHidden: false
    }
  },

  {
    path: "/shop",
    name: "Shop",
    component: () => import("../pages/Shop/index.vue"),
    meta: {
      isHidden: false
    }
  },
  {
    // 结算中心 在这个里面有收货的地址和购买的商品
    name: 'trade',
    path: '/trade',
    component: () => import("../pages/Trade/index.vue"),

  },
  // {
  //   name: 'order',
  //   path: '/order',
  //   component: () => import("../pages/Trade/components/Order/Order.vue"),

  // },
  // {

  //   name: 'address',
  //   path: '/address',
  //   component: () => import("../pages/Trade/components/address/address.vue"),

  // },

  {
    path: "/login",
    name: "Login",
    component: () => import("../pages/Login/index.vue"),
    meta: {
      isHidden: true
    },
    // children: [
    //   {
    //     path: '/userLogin',
    //     name: 'UserLogin',
    //     component: () => import("../pages/Login/userLogin.vue"),
    //   }
    // ]
  },
  // {
  //   path: "/pagelogin",
  //   name: "pageLogin",
  //   component: () => import("@/pages/Login/login.vue"),
  //   meta:{
  //     isHidden:true
  //   }
  // },
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: '/:pathMatch(.*)',
    name: 'Any',
    redirect: '/login',
  }

];
// children: [
//   {
//     name: "Goods",
//     path: "/category/goods",
//     component: () => import("../pages/Category/goods/index.vue"),
//     meta: {
//       title: "weini",
//     },
//     children: [
//       {
//         name: "Iphone",
//         path: "/category/shop/iphone",
//         component: () => import("../pages/Category/goods/iphone/index.vue"),
//         meta: {
//           title: "shouji",
//         }
//       },
//     ]
  
//   }
// ]